#!/bin/bash

binlogdir=/var/lib/mysql

file=`ls -lt $binlogdir|egrep 'mysql-[012345689]+-bin\.[0123456789]+'|awk '{print $9}'|head -1`

echo $file
